using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TopographicProductionTools._Workflow._Properties
{
    /// <summary>
    /// <para>Update Extended Property</para>
    /// <para>Updates an extended property in the identified properties table for the chosen job.</para>
    /// <para>更新所选作业的已标识属性表中的扩展属性。</para>
    /// </summary>    
    [DisplayName("Update Extended Property")]
    public class UpdateExtendedProperty : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public UpdateExtendedProperty()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_job_id">
        /// <para>Job ID</para>
        /// <para>The Job ID of the Workflow Manager (Classic) job that will be updated.</para>
        /// <para>将更新的 Workflow Manager （Classic） 作业的作业 ID。</para>
        /// </param>
        /// <param name="_properties_table_name">
        /// <para>Properties Table Name</para>
        /// <para>The name of the extended properties table that will be updated.</para>
        /// <para>将要更新的扩展属性表的名称。</para>
        /// </param>
        /// <param name="_property_field">
        /// <para>Property Field</para>
        /// <para>The property to be updated in the extended properties table.</para>
        /// <para>要在扩展属性表中更新的属性。</para>
        /// </param>
        /// <param name="_value">
        /// <para>Value</para>
        /// <para>The value that will be set for the extended property.</para>
        /// <para>将为扩展属性设置的值。</para>
        /// </param>
        public UpdateExtendedProperty(long? _job_id, object _properties_table_name, object _property_field, object _value)
        {
            this._job_id = _job_id;
            this._properties_table_name = _properties_table_name;
            this._property_field = _property_field;
            this._value = _value;
        }
        public override string ToolboxName => "Topographic Production Tools";

        public override string ToolName => "Update Extended Property";

        public override string CallName => "topographic.UpdateExtendedProperty";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_job_id, _properties_table_name, _property_field, _value, _increment_value.GetGPValue(), _database_path, _updated_job_id];

        /// <summary>
        /// <para>Job ID</para>
        /// <para>The Job ID of the Workflow Manager (Classic) job that will be updated.</para>
        /// <para>将更新的 Workflow Manager （Classic） 作业的作业 ID。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Job ID")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long? _job_id { get; set; }


        /// <summary>
        /// <para>Properties Table Name</para>
        /// <para>The name of the extended properties table that will be updated.</para>
        /// <para>将要更新的扩展属性表的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Properties Table Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _properties_table_name { get; set; }


        /// <summary>
        /// <para>Property Field</para>
        /// <para>The property to be updated in the extended properties table.</para>
        /// <para>要在扩展属性表中更新的属性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Property Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _property_field { get; set; }


        /// <summary>
        /// <para>Value</para>
        /// <para>The value that will be set for the extended property.</para>
        /// <para>将为扩展属性设置的值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _value { get; set; }


        /// <summary>
        /// <para>Increment Value</para>
        /// <para><xdoc>
        ///   <para>If a value already exists for the chosen property, this parameter specifies whether the increment value will be added to the current value or will replace the current value.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The specified value will be added to any existing value for the property.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The specified value will replace the existing value for the property.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果所选属性已存在值，则此参数指定是将增量值添加到当前值还是替换当前值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 指定值将添加到属性的任何现有值中。</bullet_item><para/>
        ///     <bullet_item>未选中 - 指定值将替换属性的现有值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Increment Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _increment_value_value? _increment_value { get; set; } = null;

        public enum _increment_value_value
        {
            /// <summary>
            /// <para>INCREMENT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INCREMENT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>REPLACE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("REPLACE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Input Database Path</para>
        /// <para>The Workflow Manager (Classic) database connection file (.jtc) that contains the job information. If no connection file is specified, the current default Workflow Manager (Classic) database will be used.</para>
        /// <para>包含作业信息的 Workflow Manager （Classic） 数据库连接文件 （.jtc）。如果未指定连接文件，则将使用当前默认的 Workflow Manager （Classic） 数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Database Path")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _database_path { get; set; } = null;


        /// <summary>
        /// <para>Updated Job ID</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Job ID")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public long _updated_job_id { get; set; }


        public UpdateExtendedProperty SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}